package com.liu.springbootvalidation.controller;

import com.liu.springbootvalidation.entity.User;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;


@RestController
public class UserController {
    @PostMapping("/user")
    public User saveUser(@Valid @RequestBody User user){
        return user;
    }
}
